<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>客户端登录</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="header">
    <div class="app-name" th:text="${@environment.getProperty('spring.application.name')}">Client App</div>
</div>

<div class="container">
    <div class="card">
        <h1>登录到应用</h1>

        <div th:if="${param.error}" class="error">
            登录失败，请重试
        </div>

        <p>您将被重定向到单点登录系统进行认证</p>

        <!-- 使用正确的OAuth2授权端点 -->
        <a th:href="@{/oauth2/authorization/client1}" class="btn">登录系统</a>
    </div>
</div>
</body>
<style>

    /* ===== 基础样式重置 ===== */
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        background-color: #f8f9fa;
        color: #333;
        line-height: 1.6;
    }

    /* ===== 头部样式 ===== */
    .header {
        background-color: #343a40;
        color: white;
        padding: 1rem 2rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .app-name {
        font-size: 1.25rem;
        font-weight: 600;
    }

    /* ===== 容器样式 ===== */
    .container {
        max-width: 800px;
        margin: 2rem auto;
        padding: 0 1rem;
    }

    /* ===== 卡片样式 ===== */
    .card {
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        padding: 2rem;
        margin-bottom: 2rem;
    }

    .card h1, .card h2, .card h3 {
        color: #343a40;
        margin-top: 0;
        margin-bottom: 1rem;
    }

    .card p {
        margin-bottom: 1rem;
    }

    /* ===== 按钮样式 ===== */
    .btn {
        display: inline-block;
        padding: 0.75rem 1.5rem;
        background-color: #007bff;
        color: white;
        text-decoration: none;
        border-radius: 4px;
        font-weight: 500;
        text-align: center;
        cursor: pointer;
        transition: background-color 0.3s;
        border: none;
        font-size: 1rem;
    }

    .btn:hover {
        background-color: #0069d9;
    }

    .btn-logout {
        background-color: #dc3545;
    }

    .btn-logout:hover {
        background-color: #c82333;
    }

    .btn-group {
        display: flex;
        gap: 1rem;
        margin-top: 1rem;
    }

    /* ===== 用户信息样式 ===== */
    .user-info {
        background-color: #e9ecef;
        padding: 1rem;
        border-radius: 4px;
        margin-top: 1.5rem;
    }

    .user-info p {
        margin: 0.5rem 0;
    }

    /* ===== 令牌信息样式 ===== */
    .token-info {
        background-color: #f8f9fa;
        border-left: 4px solid #007bff;
        padding: 1rem;
        margin: 1.5rem 0;
        font-family: monospace;
        font-size: 0.9rem;
        white-space: pre-wrap;
        word-break: break-all;
    }

    /* ===== 错误消息样式 ===== */
    .error {
        color: #dc3545;
        background-color: #f8d7da;
        border: 1px solid #f5c6cb;
        padding: 0.75rem;
        border-radius: 4px;
        margin: 1rem 0;
        text-align: center;
    }

    /* ===== 表单样式 ===== */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    .form-group input[type="text"],
    .form-group input[type="password"] {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #ced4da;
        border-radius: 4px;
        font-size: 1rem;
    }

    .form-group input[type="text"]:focus,
    .form-group input[type="password"]:focus {
        border-color: #80bdff;
        outline: none;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

    /* ===== 登录容器样式 ===== */
    .login-container {
        max-width: 400px;
        margin: 0 auto;
        padding: 2rem;
        background: white;
        border-radius: 8px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .login-container h2 {
        text-align: center;
        margin-bottom: 1.5rem;
    }

    /* ===== 页脚样式 ===== */
    .footer {
        text-align: center;
        margin-top: 2rem;
        color: #6c757d;
        font-size: 0.9rem;
    }

    /* ===== 链接样式 ===== */
    a {
        color: #007bff;
        text-decoration: none;
    }

    a:hover {
        text-decoration: underline;
    }

    /* ===== 工具类 ===== */
    .text-center {
        text-align: center;
    }

    .mt-1 {
        margin-top: 0.25rem;
    }

    .mt-2 {
        margin-top: 0.5rem;
    }

    .mt-3 {
        margin-top: 1rem;
    }

    .mt-4 {
        margin-top: 1.5rem;
    }

    .mt-5 {
        margin-top: 3rem;
    }

    /* ===== 响应式调整 ===== */
    @media (max-width: 768px) {
        .container {
            padding: 0 1rem;
        }

        .header {
            flex-direction: column;
            padding: 1rem;
        }

        .app-name {
            margin-bottom: 1rem;
        }

        .btn-group {
            flex-direction: column;
        }

        .login-container {
            padding: 1.5rem;
        }
    }

    /* ===== 动画效果 ===== */
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .fade-in {
        animation: fadeIn 0.5s ease-out;
    }

    /* ===== 加载指示器 ===== */
    .loader {
        border: 4px solid #f3f3f3;
        border-top: 4px solid #3498db;
        border-radius: 50%;
        width: 30px;
        height: 30px;
        animation: spin 1s linear infinite;
        margin: 1rem auto;
        display: none;
    }

    @keyframes spin {
        0% {
            transform: rotate(0deg);
        }
        100% {
            transform: rotate(360deg);
        }
    }

    /* ===== 状态指示器 ===== */
    .status-indicator {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        margin-right: 0.5rem;
    }

    .status-active {
        background-color: #28a745;
    }

    .status-inactive {
        background-color: #dc3545;
    }

    /* ===== 表格样式 ===== */
    .table {
        width: 100%;
        border-collapse: collapse;
        margin: 1rem 0;
    }

    .table th, .table td {
        padding: 0.75rem;
        text-align: left;
        border-bottom: 1px solid #dee2e6;
    }

    .table th {
        background-color: #f8f9fa;
        font-weight: 600;
    }

    .table tr:hover {
        background-color: rgba(0, 123, 255, 0.05);
    }

    /* ===== 表单提交按钮 ===== */
    .btn-submit {
        width: 100%;
        padding: 0.75rem;
        background-color: #28a745;
        color: white;
        border: none;
        border-radius: 4px;
        font-size: 1rem;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .btn-submit:hover {
        background-color: #218838;
    }

    /* ===== 卡片标题 ===== */
    .card-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #dee2e6;
    }

    /* ===== 徽章样式 ===== */
    .badge {
        display: inline-block;
        padding: 0.25em 0.4em;
        font-size: 75%;
        font-weight: 700;
        line-height: 1;
        text-align: center;
        white-space: nowrap;
        vertical-align: baseline;
        border-radius: 0.25rem;
        color: #fff;
        background-color: #6c757d;
    }

    .badge-primary {
        background-color: #007bff;
    }

    .badge-success {
        background-color: #28a745;
    }

    .badge-danger {
        background-color: #dc3545;
    }

    /* ===== 输入组 ===== */
    .input-group {
        display: flex;
        margin-bottom: 1rem;
    }

    .input-group input {
        flex: 1;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    .input-group .btn {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }

    /* ===== 消息提示 ===== */
    .alert {
        padding: 0.75rem 1.25rem;
        margin-bottom: 1rem;
        border: 1px solid transparent;
        border-radius: 0.25rem;
    }

    .alert-success {
        color: #155724;
        background-color: #d4edda;
        border-color: #c3e6cb;
    }

    .alert-danger {
        color: #721c24;
        background-color: #f8d7da;
        border-color: #f5c6cb;
    }

    .alert-info {
        color: #0c5460;
        background-color: #d1ecf1;
        border-color: #bee5eb;
    }

    /* ===== 分隔线 ===== */
    .divider {
        height: 1px;
        background-color: #dee2e6;
        margin: 1.5rem 0;
    }

</style>
</html>
